import VueRouter from 'Vue-Router'


//导入对应的路由组件
import homecon from './components/tabbar/homecon.vue'
import membercon from './components/tabbar/membercon.vue'
import shopcarcon from './components/tabbar/shopcarcon.vue'
import searchcon from './components/tabbar/searchcon.vue'
import newslist from './components/news/newslist.vue'
import newsinfo from './components/news/newsinfo.vue'
import photolist from './components/photos/photoList.vue'
import photoinfo from './components/photos/photoInfo.vue'
import Goodslist from './components/goods/goodslist.vue'
import Goodsinfo from './components/goods/goodsinfo.vue'
import goodsdesc from './components/goods/goodsdesc.vue'
import goodscomment from './components/goods/goodscomment.vue'
// 3. 创建路由对象
var router=new VueRouter({
    routes:[//路由规则
        {path:'/',redirect:'/home'},
        {path:'/home',component:homecon},
        {path:'/member',component:membercon},
        {path:'/shopcar',component:shopcarcon},
        {path:'/search',component:searchcon},
        {path:'/home/newslist',component:newslist},
        {path:'/home/newsinfo/:id',component:newsinfo},
        {path:'/home/photolist',component:photolist},
        {path:'/home/photoinfo/:id',component:photoinfo},
        {path:'/home/goodslist',component:Goodslist},
        {path:'/home/goodsinfo/:id',component:Goodsinfo},
        {path:'/home/goodsdesc/:id',component:goodsdesc,name:'goodsdesc'},
        {path:'/home/goodscomment/:id',component:goodscomment,name:'goodscomment'}
    ],
    linkActiveClass:'mui-active'//覆盖默认的路由高亮的类
})
// 把路由对象暴露出去
export default router